﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Model;
using Controller;

namespace Facade
{
    public class KPIAssignDetailFacade
    {
        public string Save(KPIAssignDetail KPIs)
        {
            KPIAssignDetailController cont = new KPIAssignDetailController();
            return cont.Save(KPIs);
        }

        public bool Save(KPIAssign KpiAssign, KPIAssignDetail KpiAssignDtl,Employee EmployeeAssign)
        {
            KPIAssignDetailController cont = new KPIAssignDetailController();
            return cont.Save(KpiAssign,KpiAssignDtl,EmployeeAssign);
        }

        public string Delete(KPIAssignDetail KPIs)
        {
            KPIAssignDetailController cont = new KPIAssignDetailController();
            return cont.Delete(KPIs);
        }

        

        public string UnSignKPI(int KpiID,int EmployeeID)
        {
            KPIAssignDetailController cont = new KPIAssignDetailController();
            return cont.UnSignKPI(KpiID, EmployeeID);
        }

        public string UnSignKPIMandatory(int KpiID, int EmployeeID)
        {
            KPIAssignDetailController cont = new KPIAssignDetailController();
            return cont.UnSignKPIMandatory(KpiID, EmployeeID);
        }

        public string SignKPI(int KpiID)
        {
            KPIAssignDetailController cont = new KPIAssignDetailController();
            return cont.SignKPI(KpiID);
        }

        public bool BeforeUnSignKPI(int EmployeeIDAssign, int userID)
        {
            KPIAssignDetailController cont = new KPIAssignDetailController();
            return cont.BeforeUnSignKPI(EmployeeIDAssign, userID);
        }

        public string BeforeAssignKPI(int KpiID,int EmployeeID)
        {
            KPIAssignDetailController cont = new KPIAssignDetailController();
            return cont.BeforeAssignKPI(KpiID, EmployeeID);
        }

        public IList<KPIAssignDetail> GetAllByUserID(string sSearch, int CurrentUser, int PageNumber, int DataLength, string SortCol, string SortDirection, out int TotalData, int year)
        {
            IList<KPIAssignDetail> KPIs = new List<KPIAssignDetail>();
            KPIAssignDetailController cont = new KPIAssignDetailController();
            KPIs = cont.GetAllByUserID(sSearch, CurrentUser, PageNumber, DataLength, SortCol, SortDirection, out TotalData, year);
            return KPIs;
        }

        public IList<KPIAssignDetail> GetAll(string sSearch, int PageNumber, int DataLength, string SortCol, string SortDirection, out int TotalData, Employee User, int year)
        {
            IList<KPIAssignDetail> KPIs = new List<KPIAssignDetail>();
            KPIAssignDetailController cont = new KPIAssignDetailController();
            KPIs = cont.GetAll(sSearch, PageNumber, DataLength, SortCol, SortDirection, out TotalData, User, year);
            return KPIs;
        }

        public IList<KPIAssignDetail> GetAllNon(string sSearch, int PageNumber, int DataLength, string SortCol, string SortDirection, out int TotalData, Employee User, int year)
        {
            IList<KPIAssignDetail> KPIs = new List<KPIAssignDetail>();
            KPIAssignDetailController cont = new KPIAssignDetailController();
            KPIs = cont.GetAllNon(sSearch, PageNumber, DataLength, SortCol, SortDirection, out TotalData, User, year);
            return KPIs;
        }

        public KPIAssignDetail GetKPIAssignDetailByID(int ID)
        {
            KPIAssignDetail KPIs = new KPIAssignDetail();
            KPIAssignDetailController cont = new KPIAssignDetailController();
            KPIs = cont.GetKPIAssignDetailByID(ID);
            return KPIs;
        }

        public IList<KPIAssignDetail> GetKPIAssignDetailByKPIAssignID(int KPIAssignID)
        {
            IList<KPIAssignDetail> KPIs = new List<KPIAssignDetail>();
            KPIAssignDetailController cont = new KPIAssignDetailController();
            KPIs = cont.GetKPIAssignDetailByKPIAssignID(KPIAssignID);
            return KPIs;
        }

        public IList<KPIAssignDetail> GetEmployeeKPIAssignDetailByKPIAssignID(int KPIAssignID)
        {
            IList<KPIAssignDetail> KPIs = new List<KPIAssignDetail>();
            KPIAssignDetailController cont = new KPIAssignDetailController();
            KPIs = cont.GetEmployeeKPIAssignDetailByKPIAssignID(KPIAssignID);
            return KPIs;
        }

        public decimal GetEmployeeTotalKPIWeight(Employee employee, int year)
        {
            KPIAssignDetailController cont = new KPIAssignDetailController();
            return cont.GetEmployeeTotalKPIWeight(employee, year);
        }

        public decimal GetEmployeeTotalKPIWeightNon(Employee employee, int year)
        {
            KPIAssignDetailController cont = new KPIAssignDetailController();
            return cont.GetEmployeeTotalKPIWeightNon(employee, year);
        }
    }
}